<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      Git-2.26.0
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;13.&nbsp;Programming
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="gdb.html" title="GDB-9.1">Prev</a>
          <p>
            GDB-9.1
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="guile.html" title="Guile-3.0.2">Next</a>
          <p>
            Guile-3.0.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="prog.html" title=
          "Chapter&nbsp;13.&nbsp;Programming">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="git" name="git"></a>Git-2.26.0
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to Git
        </h2>
        <p>
          <span class="application">Git</span> is a free and open source,
          distributed version control system designed to handle everything
          from small to very large projects with speed and efficiency. Every
          <span class="application">Git</span> clone is a full-fledged
          repository with complete history and full revision tracking
          capabilities, not dependent on network access or a central server.
          Branching and merging are fast and easy to do. <span class=
          "application">Git</span> is used for version control of files, much
          like tools such as <a class="xref" href="mercurial.html" title=
          "Mercurial-5.3.1">Mercurial-5.3.1</a>, <span class=
          "application">Bazaar</span>, <a class="xref" href="subversion.html"
          title="Subversion-1.13.0">Subversion-1.13.0</a>, <a class="ulink"
          href="http://www.nongnu.org/cvs/">CVS</a>, <span class=
          "application">Perforce</span>, and <span class="application">Team
          Foundation Server</span>.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://www.kernel.org/pub/software/scm/git/git-2.26.0.tar.xz">
                https://www.kernel.org/pub/software/scm/git/git-2.26.0.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 251c26b32398db3551c24dc806845855
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 5.7 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 319 MB (with downloaded
                documentation)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.3 SBU (with parallelism=4; add 2.5
                SBU for tests with parallelism=4)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Additional Downloads
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                <a class="ulink" href=
                "https://www.kernel.org/pub/software/scm/git/git-manpages-2.26.0.tar.xz">
                https://www.kernel.org/pub/software/scm/git/git-manpages-2.26.0.tar.xz</a>
                (not needed if you've installed <a class="xref" href=
                "asciidoc.html" title="Asciidoc-8.6.9">asciidoc-8.6.9</a>,
                <a class="xref" href="../pst/xmlto.html" title=
                "xmlto-0.0.28">xmlto-0.0.28</a>, and prefer to rebuild them)
              </p>
            </li>
            <li class="listitem">
              <p>
                <a class="ulink" href=
                "https://www.kernel.org/pub/software/scm/git/git-htmldocs-2.26.0.tar.xz">
                https://www.kernel.org/pub/software/scm/git/git-htmldocs-2.26.0.tar.xz</a>
                and other docs (not needed if you've installed <a class=
                "xref" href="asciidoc.html" title=
                "Asciidoc-8.6.9">asciidoc-8.6.9</a> and want to rebuild the
                documentation).
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Git Dependencies
        </h3>
        <h4>
          Recommended
        </h4>
        <p class="recommended">
          <a class="xref" href="../basicnet/curl.html" title=
          "cURL-7.69.1">cURL-7.69.1</a> (needed to use <span class=
          "application">Git</span> over http, https, ftp or ftps)
        </p>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="pcre2.html" title=
          "PCRE2-10.34">pcre2-10.34</a> (<span class=
          "emphasis"><em>or</em></span> the deprecated <a class="xref" href=
          "pcre.html" title="PCRE-8.44">PCRE-8.44</a>), in either case
          configured with <code class="literal">--enable-jit</code>,
          <a class="xref" href="subversion.html" title=
          "Subversion-1.13.0">Subversion-1.13.0</a> with Perl bindings (for
          <span class="command"><strong>git svn</strong></span>), <a class=
          "xref" href="tk.html" title="Tk-8.6.10">Tk-8.6.10</a> (gitk, a
          simple <span class="application">Git</span> repository viewer, uses
          <span class="application">Tk</span> at runtime), and <a class=
          "xref" href="valgrind.html" title=
          "Valgrind-3.15.0">Valgrind-3.15.0</a>
        </p>
        <h4>
          Optional (to create the man pages, html docs and other docs)
        </h4>
        <p class="optional">
          <a class="xref" href="../pst/xmlto.html" title=
          "xmlto-0.0.28">xmlto-0.0.28</a> and <a class="xref" href=
          "asciidoc.html" title="Asciidoc-8.6.9">asciidoc-8.6.9</a> or
          <a class="ulink" href="http://asciidoctor.org/">AsciiDoctor</a>,
          and also <a class="ulink" href=
          "http://dblatex.sourceforge.net/">dblatex</a> (for the PDF version
          of the user manual), and <a class="ulink" href=
          "http://docbook2x.sourceforge.net/">docbook2x</a> to create info
          pages
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/git">http://wiki.linuxfromscratch.org/blfs/wiki/git</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of Git
        </h2>
        <p>
          Install <span class="application">Git</span> by running the
          following commands:
        </p>
        <pre class="userinput">
<kbd class="command">./configure --prefix=/usr \
            --with-gitconfig=/etc/gitconfig \
            --with-python=python3 &amp;&amp;
make</kbd>
</pre>
        <p>
          You can build the man pages and/or html docs, or use downloaded
          ones. If you choose to build them, use next two following
          instructions.
        </p>
        <p>
          If you have installed <a class="xref" href="asciidoc.html" title=
          "Asciidoc-8.6.9">asciidoc-8.6.9</a> you can create the html version
          of the man pages and other docs:
        </p>
        <pre class="userinput">
<kbd class="command">make html</kbd>
</pre>
        <p>
          If you have installed <a class="xref" href="asciidoc.html" title=
          "Asciidoc-8.6.9">asciidoc-8.6.9</a> and <a class="xref" href=
          "../pst/xmlto.html" title="xmlto-0.0.28">xmlto-0.0.28</a> you can
          create the man pages:
        </p>
        <pre class="userinput">
<kbd class="command">make man</kbd>
</pre>
        <p>
          The test suite can be run in parallel mode. To run the test suite,
          issue: <span class="command"><strong>make test</strong></span>. If
          run as a normal user, 0 tests should be reported as failed in the
          final summary.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install</kbd>
</pre>
        <h3>
          If you created the man pages and/or html docs
        </h3>
        <p>
          Install the man pages as <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install-man</kbd>
</pre>
        <p>
          Install the html docs as <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class=
"command">make htmldir=/usr/share/doc/git-2.26.0 install-html</kbd>
</pre>
        <h3>
          If you downloaded the man pages and/or html docs
        </h3>
        <p>
          If you downloaded the man pages untar them as the <code class=
          "systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">tar -xf ../git-manpages-2.26.0.tar.xz \
    -C /usr/share/man --no-same-owner --no-overwrite-dir</kbd>
</pre>
        <p>
          If you downloaded the html docs untar them as the <code class=
          "systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">mkdir -vp   /usr/share/doc/git-2.26.0 &amp;&amp;
tar   -xf   ../git-htmldocs-2.26.0.tar.xz \
      -C    /usr/share/doc/git-2.26.0 --no-same-owner --no-overwrite-dir &amp;&amp;

find        /usr/share/doc/git-2.26.0 -type d -exec chmod 755 {} \; &amp;&amp;
find        /usr/share/doc/git-2.26.0 -type f -exec chmod 644 {} \;</kbd>
</pre>
        <h3>
          Reorganize text and html in the html-docs (both methods)
        </h3>
        <p>
          For both methods, the html-docs include a lot of plain text files.
          Reorganize the files as the <code class="systemitem">root</code>
          user:
        </p>
        <pre class="root">
<kbd class=
"command">mkdir -vp /usr/share/doc/git-2.26.0/man-pages/{html,text}         &amp;&amp;
mv        /usr/share/doc/git-2.26.0/{git*.txt,man-pages/text}     &amp;&amp;
mv        /usr/share/doc/git-2.26.0/{git*.,index.,man-pages/}html &amp;&amp;

mkdir -vp /usr/share/doc/git-2.26.0/technical/{html,text}         &amp;&amp;
mv        /usr/share/doc/git-2.26.0/technical/{*.txt,text}        &amp;&amp;
mv        /usr/share/doc/git-2.26.0/technical/{*.,}html           &amp;&amp;

mkdir -vp /usr/share/doc/git-2.26.0/howto/{html,text}             &amp;&amp;
mv        /usr/share/doc/git-2.26.0/howto/{*.txt,text}            &amp;&amp;
mv        /usr/share/doc/git-2.26.0/howto/{*.,}html               &amp;&amp;

sed -i '/^&lt;a href=/s|howto/|&amp;html/|' /usr/share/doc/git-2.26.0/howto-index.html &amp;&amp;
sed -i '/^\* link:/s|howto/|&amp;html/|' /usr/share/doc/git-2.26.0/howto-index.txt</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <em class=
          "parameter"><code>--with-gitconfig=/etc/gitconfig</code></em>: This
          sets <code class="filename">/etc/gitconfig</code> as the file that
          stores the default, system wide, <span class=
          "application">Git</span> settings.
        </p>
        <p>
          <code class="option">--with-python=python3</code>: Use this switch
          to use <span class="application">Python 3</span>, instead of the
          EOL'ed <span class="application">Python 2</span>. Python is used
          for the <span class="command"><strong>git p4</strong></span>
          interface to Perforce repositories, and also used in some tests.
        </p>
        <p>
          <code class="option">--with-libpcre2</code>: Use this switch if
          <span class="application">PCRE2</span> is installed and has been
          built with the non-default JIT enabled.
        </p>
        <p>
          <code class="option">--with-libpcre</code>: As an alternative to
          PCRE2, use this switch if the deprecated <span class=
          "application">PCRE</span> is installed and has been built with the
          non-default JIT enabled.
        </p>
        <p>
          <span class="command"><strong>tar -xf ../git-manpages-2.26.0.tar.gz
          -C /usr/share/man --no-same-owner</strong></span>: This untars
          <code class="filename">git-manpages-2.26.0.tar.gz</code>. The
          <code class="option">-C</code> option makes tar change directory to
          <code class="filename">/usr/share/man</code> before it starts to
          decompress the docs. The <code class=
          "option">--no-same-owner</code> option stops tar from preserving
          the user and group details of the files. This is useful as that
          user or group may not exist on your system; this could
          (potentially) be a security risk.
        </p>
        <p>
          <span class="command"><strong>mv /usr/share/doc/git-2.26.0
          ...</strong></span>: These commands move some of the files into
          subfolders to make it easier to sort through the docs and find what
          you're looking for.
        </p>
        <p>
          <span class="command"><strong>find ... chmod ...</strong></span>:
          These commands correct the permissions in the shipped documentation
          tar file.
        </p>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring Git
        </h2>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="git-config" name="git-config"></a>
          </h3>
          <h4 class="title">
            <a id="git-config" name="git-config"></a>Config Files
          </h4>
          <p>
            <code class="filename">~/.gitconfig</code> and <code class=
            "filename">/etc/gitconfig</code>
          </p>
        </div>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">git, git-receive-pack and
              git-upload-archive (hardlinked to each other), git-cvsserver,
              git-shell, git-upload-pack, and gitk</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">None</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/usr/share/perl5/Git,
              /usr/libexec/git-core and
              /usr/share/{doc/git-2.26.0,git-core,git-gui,gitk,gitweb}</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="git-prog" name="git-prog"></a><span class=
                    "term"><span class=
                    "command"><strong>git</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the stupid content tracker.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="git-cvsserver" name=
                    "git-cvsserver"></a><span class="term"><span class=
                    "command"><strong>git-cvsserver</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a CVS server emulator for <span class=
                    "application">Git</span>.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="gitk" name="gitk"></a><span class=
                    "term"><span class=
                    "command"><strong>gitk</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a graphical <span class="application">Git</span>
                    repository browser (needs <a class="xref" href="tk.html"
                    title="Tk-8.6.10">Tk-8.6.10</a>).
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="git-receive-pack" name=
                    "git-receive-pack"></a><span class="term"><span class=
                    "command"><strong>git-receive-pack</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is invoked by <span class="command"><strong>git
                    send-pack</strong></span> and updates the repository with
                    the information fed from the remote end.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="git-shell" name="git-shell"></a><span class=
                    "term"><span class=
                    "command"><strong>git-shell</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a login shell for SSH accounts to provide restricted
                    Git access.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="git-upload-archive" name=
                    "git-upload-archive"></a><span class="term"><span class=
                    "command"><strong>git-upload-archive</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is invoked by <span class="command"><strong>git archive
                    --remote</strong></span> and sends a generated archive to
                    the other end over the git protocol.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="git-upload-pack" name=
                    "git-upload-pack"></a><span class="term"><span class=
                    "command"><strong>git-upload-pack</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is invoked by <span class="command"><strong>git
                    fetch-pack</strong></span>, it discovers what objects the
                    other side is missing, and sends them after packing.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-23 15:21:56 -0500
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="gdb.html" title="GDB-9.1">Prev</a>
          <p>
            GDB-9.1
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="guile.html" title="Guile-3.0.2">Next</a>
          <p>
            Guile-3.0.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="prog.html" title=
          "Chapter&nbsp;13.&nbsp;Programming">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
